import request from '@/utils/request'

// 手动执行定时任务
export function handExecuteJob(jobName) {
  return request({
    url: '/sys/quartz/execute',
    method: 'post',
    data: { str: jobName }
  })
}
export function getCronExpression(data) {
  return request({
    url: '/sys/quartz/getCronExpression',
    method: 'post',
    data: data
  })
}
export function saveCronJob(data) {
  return request({
    url: '/sys/quartz/save', method: 'post', data: data
  })
}
export function deleteCronJob(names) {
  return request({
    url: '/sys/quartz/delete', method: 'delete', data: { str: names }
  })
}
export function pauseCronJob(names) {
  return request({
    url: '/sys/quartz/pause', method: 'post', data: { str: names }
  })
}
export function startCronJob(names) {
  return request({
    url: '/sys/quartz/start', method: 'post', data: { str: names }
  })
}
export function quartzStatus() {
  return request({
    url: '/sys/quartz/status', method: 'get'
  })
}
export function startQuartzService() {
  return request({
    url: '/sys/quartz/startService', method: 'post'
  })
}

export function stopQuartzService() {
  return request({
    url: '/sys/quartz/stopService', method: 'post'
  })
}
export function getLogById(logId) {
  return request({
    url: '/sys/quartz/getLogErrorDetail', method: 'get',params:{logId:logId}
  })
}

